using System;
using System.Collections.Generic;
using System.Text;

using HomeLite.View;

namespace HomeLite.Controllers
{
    public class IconController
    {
        #region Event Handlers
        public event EventHandler Exit;
        public event EventHandler Configure;
        #endregion

        #region Singleton
        private static IconController _instance;
        public static IconController Instance
        {
            get
            {
                if (_instance == null) _instance = new IconController();
                return _instance;
            }
        }
        #endregion

        #region Fields
        AboutBox _aboutBox;
        #endregion

        #region Constructor | Dispose
        private IconController()
        {
        }
        public void Dispose()
        {
            if(_aboutBox != null)
            {
                _aboutBox.Dispose();
            }
        }
        #endregion

        #region Methods
        internal void CreateIcon()
        {
            _aboutBox = new AboutBox();
            _aboutBox.Exit += new EventHandler(aboutBox_Exit);
            _aboutBox.Configure += new EventHandler(aboutBox_Configure);
        }
        #endregion
        
        #region Events
        void aboutBox_Exit(object sender, EventArgs e)
        {
            Exit(sender, e);
        }

        void aboutBox_Configure(object sender, EventArgs e)
        {
            Configure(sender, e);
        } 
        #endregion
    }
}
